#pragma once

#include <iostream>
#include <string>
#include "util.hpp"

using std::string;

namespace ns_log
{
    using namespace ns_util;

    enum
    {
        INFO,
        DEBUG,
        WARNING,
        ERROR,
        FATAL
    };

    inline std::ostream &Log(const string &level, const string &file_name, int line)
    {
        string message = "[";
        message += level;
        message += "]";

        message += "[";
        message += file_name;
        message += "]";

        message += "[";
        message += std::to_string(line);
        message += "]";

        message += "[";
        message += TimeUtil::GetTimeStamp();
        message += "]";

        // cout<<Log(ERROR,file_name,line)<<"message"<<"\n";
        return std::cout << message;
    }
    // cout<<LOG(ERROR)<<"message"<<"\n";
    #define LOG(level) Log(#level, __FILE__, __LINE__)
}